#include <iostream>
using namespace std;
class Person
{
public:
    string name;
    int age;
    Person(string name,int age){
        this->age=age;
        this->name=name;
    }
    Person(){
    }
    Person& operator=(Person &p){
        if(this==&p){
            return *this;
        }
        this->age=p.age;
        this->name=p.name;
        return *this;
    }
    void show(){
        cout<<this->age<<endl;
        cout<<this->name<<endl;
    }

};
int main()
{
    Person p1("张三",18);
    Person p2;
    p2=p1;
    p2.show();
    p1.show();
    return 0;
}